<include file="Public:header"/>
<link href="__PUBLIC__/css/share.css" rel="stylesheet" type="text/css" />

		<div class="containner">
        <include file="Index:header"/>
        <!--导航结束--> 
        <div id="myshare" style="position:absolute;top:0px;margin:auto;z-index:299"></div>
        <div class="body-center">
            <div class="w_tithead"> <strong>您当前的位置是： </strong>
	            <a href="__APP__">品购网首页</a>
	            <a href="__APP__/Industry/index/id/{$share.industry_id}">{$share.industry_id|getIndustry}</a>
	            <a  href="__APP__/home/Share/shareList/commodity_id/{$share.commodity_id}">分享内容</a>
	            {$share.caption|html_entity_decode=###}
	        </div>
       
            <div class="share_pic"></div>
            <div class="detail">
                <div class="person_message">
                    <img src="{$user.user_photo|default='__ROOT__/Public/images/user_photo.jpg'}" height="90" width="90" class="headperson">
                    <ul>
                        <li class="blue"><font color="blue">{$user.user_name}</font></li>
                        <li>&nbsp;</li>
                        <li>被 <span class="yellow" id="">{$user.flow_count}</span> 人关注了</li>
                        <li><div id="guanzhu_btn" class="guanzhu_btn" onclick="addFlow();"></div></li>
                    </ul>
                </div>
                <div class="subject">
                    <h3>{$share.caption|html_entity_decode=###}</h3>
                    <div class="sub">
                        <div class="date">发布时间：{$share.time_add|date="Y-m-d",###}</div>
                        <div class="nums">浏览：<span class="yellow">{$share.count_view}</span>次  评分：<span class="yellow">{$share.score|intval}</span>分</div>
                    </div>
                </div>
            </div>
            <div class="sharecontent">
				{$share.content|html_entity_decode=###|stripslashes=###}
            </div>
            <if condition="$share_added_list">
            <div class="sharecontent">
                <h3><sup><B><U><font color="#AE0000">补充分享：</Font></U></B></sup></h3>
                <volist name="share_added_list" id="share_added">
                    <p>
                        {$share_added.content|stripslashes=###|html_entity_decode=###}
                        <hr width=100%></hr>
                    </p>
                </volist>
            </div>
            </if>
            
            <div class="solid" style="clear:both;"></div>
            <div class="tag">
            	<div id="hide_tag" style="display:none;">
	              <form action="__URL__/tagAdd/share_id/{$_GET['id']}" name="form" method="POST">
	          		<div>
		          		<ul>
		          		<li><span>标签:</span><input type="text" name="subject" value="{$tags.user_tags}" >(多个标签用空格分隔): </li>
		          		<li><span>我的标签：</span>
		          			<span>
		          			  <volist name="tags.user" id="val">
		          				<span class="tag_subject"><a>{$val.subject}</a></span>
		          			  </volist>
		          			</span>
		          		</li>
		          		<li><span>常用标签：</span>
		          			<span>
		          			  <volist name="tags.usual" id="val"> 
		          				<span class="tag_subject"><a href="__APP__/Tag/tagShareList/subject/{$val.subject}">{$val.subject}</a></span>
		          			  </volist>
		          			</span>
		          		</li>
		          		</ul>
	          		</div>
	          		<div class="reply">
		          		<ul>
		          		<li><span>评论：</span></li>
		          		<li><textarea name="message" style="width:600px; font-size:12px;"></textarea></li>
		          		<li>
		          			<eq name="is_favorite" value="0">
		          				<label><input type="checkbox" checked="checked" name="favorite" value="1">加入收藏</label>
		          			<else/>
		          				已收藏
		          			</eq>
		          			<gt name="local['id']" value="0">
		          				<input type="submit" name="" value="提交"  style="margin-left:480px;"/>
		          			<else/>
		          				<span style="margin-left:300px;">请先登录，才能创建标签，发表评论。</span>
		          			</gt>
		          		</li>
		          		</ul>
	          		</div>
	          	  </form>
          	    </div>
          	    
         	  	<div class="show_tag">
	          		<ul>
	          		<li><a class="create_tag"><if condition="$tags.user neq ''">编辑<else/>创建</if>标签</a></li>
	          		<li><span>我的标签：</span>
	          			<span>
	          			  <volist name="tags.user" id="val">
	          				<span class="tag_subject"><a>{$val.subject}</a></span>
	          			  </volist>
	          			</span>
	          		</li>
	          		<li><span>常用标签：</span>
	          			<span>
	          			  <volist name="tags.usual" id="val"> 
	          				<span class="tag_subject"><a href="__APP__/Tag/tagShareList/subject/{$val.subject}">{$val.subject}</a></span>
	          			  </volist>
	          			</span>
	          		</li>
	          		
	          		<li>已有{$share.count_fav}个用户收藏本帖</li>
	          		</ul>
          		</div>
          		<div>
          		  <ul>
          		  <volist name="reply" id="val">
          			<li class="replys">
	          		  <img width="80" height="80" src="{$val.user_photo|default='__ROOT__/Public/images/user_photo.jpg'}">
	          		  <div class="reply_right"><span style="color:#ff9900;">{$val.user_name}</span> <span style="color:#ff6633;">{$create_time|date="Y-m-d H:i:s ###"}</span></div>
	          		  <div class="reply_right"><p>{$val.message}</p></div>
          			</li>
          		  </volist>
          		  </ul>
          		</div>
          		
          		
          		
            </div>
            
            <span class="pinfen">当前该商品的评分为：<span class="yellow" id="fen">{$share.score}</span>分</span>
            <div class="star_div" id="star_div">
              <div><font color="#0088A8">请您为本帖所指商品打分：</font></div>
                <span>评分器：</span>
                <ul class="star">
                    <li score="10" title="杯具"><div>10</div></li>
                    <li score="20" title="杯具"><div>20</div></li>
                    <li score="30" title="杯具"><div>30</div></li>
                    <li score="40" title="杯具"><div>40</div></li>
                    <li score="50" title="杯具"><div>50</div></li>
                    <li score="60" title="良好"><div>60</div></li>
                    <li score="70" title="良好"><div>70</div></li>
                    <li score="80" title="良好"><div>80</div></li>
                    <li score="90" title="完美"><div>90</div></li>
                    <li score="100" title="完美"><div>100</div></li>
                </ul>
                <span>评分：<span class="yellow" id="fen"></span>分</span>
            </div>
            <div class="block"></div>
        </div>
        
        
    <include file="Index:bottom" />
    <!--页尾部分-->
	</div>
	
    </body>
</html>

<script type="text/javascript"> 

$('#add_tag').click(function(){
	$("#hidden_tag_add").show();
	$("#add_tag").hide();
});
$('.create_tag').wBox({target:"#hide_tag", title:"标签"});
</script>
<script>
    function fabiaoyinxiangci(){
        var value = $.trim($("#yinxiangCi").val());

        if(value.length>30 || value.length<=0){
            alert('发表失败');
            return false;
        }
        var id = $('#share_id').val();
        var url="__APP__/Home/Brand/add"
        $.post(url,
        {
            id:id,
            caption: value
        },
        function(data){
           
            if(data == 1){
                alert('发表成功');
                $("#star_div").css("display","block");
                y=document.body.clientHeight;
                y=document.body.offsetHeight;
                x=0;
                window.scrollTo(x,y)
            }
            else if(data == 3){
                alert('您已对该分享发表过印象');
            }
            else{
                alert('发表失败');
            }
        }
    );       
    }
    function addyinxiangcinum(value){
        value = $.trim(value);
        //alert(value);
        var id = $('#share_id').val();
        var url="__APP__/Home/Brand/addNum"
        $.post(url,
        {
            id:id,
            caption: value
        },
        function(data){

            if(data == 1){
                alert('发表成功');
                $("#star_div").css("display","block");
                y=document.body.clientHeight;
                y=document.body.offsetHeight;
                x=0;
                window.scrollTo(x,y)
            }
            else if(data == 3){
                 alert('您已对该分享发表过印象');
            }
            else{
                alert('发表失败');
            }
        }
    );


    }

    function addScore(score){
        score = $.trim(score);
        //alert(score);
        var id = $('#share_id').val();
        var url="__APP__/Home/Share/addScore"
        $.get(url,
        {
            id:id,
            score: score
        },
        function(data){
            if(data == 1){
                alert('评分成功');
                window.location.reload();
            }
            else{
                alert('评分失败');
            }
        }
    );
    }

    function addFlow(){
        var id = $('#share_id').val();
        var url="__APP__/Home/Share/addFlow"
        $.get(url,
        {
            id:id           
        },
        function(data){            
            if(data == 1){
                var num = $("#flowed").text();
                num = parseInt(num) +1;
                $("#flowed").text(num);
                alert('关注成功');                
            }
            else if(data == 2){
                alert('请不要关注自己');
            }
            else if(data == 3){
                alert('已关注');
            }
            else{
                alert('关注失败');
            }
        }
    );
    }
    function addFavorites(){
        var id = $('#share_id').val();
        var url="__APP__/Home/Share/addFavorites"
        $.get(url,
        {
            id:id
        },
        function(data){            
            if(data == 1){
                var num = $("#Favorited").text();
                num = parseInt(num) +1;
                $("#Favorited").text(num);
                alert('采纳成功');
            }
            else if(data == 2){
                    
                alert('请不要采纳自己的分享');
            }
            else if(data == 3){
                alert('已采纳');
            }
            else{
                alert('采纳失败');
            }
        }
    );
    }

    function bindmouseoverheadperson(){
        $(".headperson").mouseover(function(e){
            var userid = {$share.userid};
            $.get("__APP__/Home/User/userInfoAjax",
            {userid:userid},
            function(date){
                $("body").append(date);
                $(".person").css("top",e.pageY);
                $(".person").css("left",e.pageX);
            });
        });
        $(".headperson").mouseout(function(e){
            var person = $(".person");
            if(!person.get(0) || !person.get(0).parentNode){return;}
            person.get(0).parentNode.removeChild(person.get(0));
        });
    }

    $(function(){
    bindStar();
    bindMorYinxiang();
    bindpulashYinx();
    //bindadoptionbtm();
    			bindmouseoverheadperson();
    fangyinxiangci();
});
</script>

